package gui;

import java.awt.Component;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * form for inputting new user financial information consists of several prompts
 * and text boxes
 * 
 * @author gke703
 */
public class FinancialInfoPanel extends JPanel {

	/** text form for personal income */
	protected ValueEntryPanel personalField;

	/** text form for household income */
	protected ValueEntryPanel householdField;

	/** text form for taxable income */
	protected ValueEntryPanel taxField;

	/** text form for child support amount */
	protected ValueEntryPanel childField;

	/** text form for amount granted in scholarships */
	protected ValueEntryPanel scholarField;

	/** text form for amount of monthly expenses */
	protected ValueEntryPanel monthlyExpensesField;

	/**
	 * displays panel with prompts and forms for financial info entry
	 */
	public FinancialInfoPanel() {

		setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));

		// add a label with a prompt to enter the new financial info
		JLabel prompt = new JLabel("Enter Financial Information");
		prompt.setMaximumSize(prompt.getPreferredSize());
		add(prompt);
		prompt.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a txtbox with the field for the entry of the student's personal
		// income
		personalField = new ValueEntryPanel("Personal Income:");
		add(personalField);
		add(personalField);
		personalField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a txtbox with the field for the entry of the student's household
		// income
		householdField = new ValueEntryPanel("Household Income:");
		add(householdField);
		// birthdateField.setMaximumSize(birthdateField.getPreferredSize());
		add(householdField);
		householdField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a txtbox with the field for the entry of the student's taxable
		// earnings
		taxField = new ValueEntryPanel("Taxable Earnings:");
		add(taxField);
		add(taxField);
		taxField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a txtbox with the field for the entry of the student's child
		// support amt
		childField = new ValueEntryPanel("Child Support Amount:");
		add(childField);
		add(childField);
		childField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a txtbox with the field for the entry of the student's
		// scholarship amount
		scholarField = new ValueEntryPanel("Scholarships:");
		add(scholarField);
		// birthdateField.setMaximumSize(birthdateField.getPreferredSize());
		add(scholarField);
		scholarField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		monthlyExpensesField = new ValueEntryPanel("Monthly Expenses:");
		add(monthlyExpensesField);
		// birthdateField.setMaximumSize(birthdateField.getPreferredSize());
		add(monthlyExpensesField);
		monthlyExpensesField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

	}

	private static final long serialVersionUID = 1L;

}